/**
 *   @file AvlTreeNode.h
 */
#ifndef _AVLTREENODE_H_
#define _AVLTREENODE_H_

#include "TreeNode.h"

namespace cppflib
{

namespace collections
{

namespace tree
{

/**
 *  Tree node of an AVL tree
 */
class _DLLAPI AvlTreeNode : public TreeNode
{
public:
    AvlTreeNode(void);
    virtual ~AvlTreeNode(void);
    int GetBalanceFactor();
    
private:
    /**
     *  balance factor = height of right subtree - height of left subtree
     *  > 0 -- right subtree is taller
     *  < 0 -- left subtree is taller
     *  must be in the range -2 <= bfactor <= 2
     */
    int bfactor;

    friend class AvlTree;
};

}  // end of namespace tree

}  // end of namespace collections

}  // end of namespace cppflib


#endif
